#version 310 es

//着色器语言标准 参考 https://www.khronos.org/registry/OpenGL/specs/es/3.1/GLSL_ES_Specification_3.10.pdf

//gl es 3.1的精度标准：highp:32bit, mediump:16~32bit, lowp:9~32位
precision highp float; //gl es要求显式定义 默认float类型精度

//float 对应samplerXX, unsigned interger 对应 usamplerXX, signed interger 对应 isamplerXX
layout(location = 0) uniform highp usampler2D tex_input;

layout(location = 20) uniform highp float multi_alpha;
layout(location = 21) uniform highp float add_beta;

//  输出也要与 线定Attachment的纹理类型相同， vecx -> float, uvecx -> unsigned int, ivecx-> signed int
out highp vec4 FragColor;
void main()
{
    uvec4 value = texelFetch(tex_input,ivec2(gl_FragCoord.xy),0);//;texture(tex_input,texpos);
    FragColor = multi_alpha * vec4(value) + add_beta;// vec4(value)/255.0f;
}
